#include <iostream>
#include <vector>
#include <unordered_map>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
#define endl '\n'
const int N = 35;
int dp[N][N];
int n, m;
void solve() 
{
    cin >> n >> m;
    dp[0][1] = 1;
   
    for(int i = 1; i <= m; i++)
    {
        for(int j = 1; j <= n; j++)
        {
            int l = j - 1, r = j + 1;
            if(l == 0) l = n;
            if(r == n + 1) r = 1;
            dp[i][j] = dp[i - 1][l] + dp[i - 1][r];
        }
    }
    cout << dp[m][1] << endl;
}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int T = 1;
	// cin >> T;
	while(T--)
	{
        solve();
	}
	return 0;
}